
function addMarker_road(point, index,posType,obj){  
	var img = "images/point_poi.png";
    var contentS = obj.content.split('||');
    var name = "";
    var type = "";
    var addr = obj.componentName;
    if(addr==undefined || addr == 'undefined'){
    	addr = "";	
    }
    var menpai="";
    var other="";
    for (var n = 0; n < contentS.length; n++) {
    var cc = contentS[n].split('|');
    switch (cc[0]) {
        case "222":
             type = cc[1];
             break;
         case "229":
             name = cc[1];
             break;
         case "230":
            // addr += cc[1];
             break;
         case "231":
             menpai = cc[1];
             addr += menpai;
             if(menpai!=""&&menpai.indexOf("号")==-1)
                addr += "号";
             break;
         case "232":
             other = cc[1];
             break;
        }
    }
	
	// 创建图标对象  
	var myIcon = new BMap.Icon(img, new BMap.Size(46, 46), {  
	// 指定定位位置。  
	// 当标注显示在地图上时，其所指向的地理位置距离图标左上  
	   // 角各偏移10像素和25像素。您可以看到在本例中该位置即是  
	   // 图标中央下端的尖角位置。  
	   offset: new BMap.Size(10, 25),  
	   // 设置图片偏移。  
	   // 当您需要从一幅较大的图片中截取某部分作为标注图标时，您  
	   // 需要指定大图的偏移位置，此做法与css sprites技术类似。  
	   //imageOffset: new BMap.Size(0, 0 - index * 25)   // 设置图片偏移  
	 });    
	 // 创建标注对象并添加到地图  
	 var marker = new BMap.Marker(point, {icon: myIcon});
	 
	 marker.addEventListener("mouseover", function(){  

		var htmlText = '<div id="popup_bg2">';
		htmlText+=     ' <div id="closebtn"><font style="cursor:pointer;" onclick="jianku('+obj.id+')"><img src="images/jianku.gif" style="vertical-align:middle;" width="48" height="24" /></font></div>';
		htmlText+=     '      <div id="textarea">';
		htmlText+=     '           <ul>';
		htmlText+=     '               <li><strong>名称</strong>：'+name+'</li>';
		htmlText+=     '               <li><strong>时间</strong>：'+obj.formatDate+'</li>';
		htmlText+=     '               <li><strong>类型</strong>：'+type+'</li>';
		htmlText+=     '               <li><strong>地址</strong>：'+addr+'</li>';
//		htmlText+=     '               <li><strong>门牌号</strong>：'+menpai+'</li>';
        htmlText+=     '               <li><strong>描述</strong>：'+other+'</li>';
        //htmlText+=     '               <li><font style="cursor:pointer;" onclick="jianku('+obj.id+')"><img src="images/btn_jk_d.png" width="110" height="40" /></font></li>';
		htmlText+=     '           </ul>';
		htmlText+=     '      </div>';
		htmlText+=     '<div id="picBG">';
		if(obj.imageUrl!=null){
			htmlText+=     '<a href ="'+obj.imageUrl+ '" target=_blank><img src="'+obj.imageUrl+'" width="345" height="124" /></a>';
		}else{
			htmlText+=     '           <div id="leftbtn"><a href="#"><img src="images/left_btn.png" width="22" height="47" /></a></div>';
			htmlText+=     '           <div id="rightbtn"><a href="#"><img src="images/right_btn.png" width="22" height="47" /></a></div>';
		}
		htmlText+=     '      </div>';
		htmlText+=     ' </div>';
		htmlText+=     '</div>';

		var opts = {  
		 width : 345,     // 信息窗口宽度  
		 height: 290,     // 信息窗口高度  
		 //title : "<b>"+name+"</b>"  // 信息窗口标题  
		}
		  
		var infoWindow = new BMap.InfoWindow(htmlText, opts);  // 创建信息窗口对象  
		map.openInfoWindow(infoWindow, point);      // 打开信息窗口   
		//alert(obj.imageUrl);
		//$("#picBG").css("background-image","url("+obj.imageUrl+")");	
	//	map.centerAndZoom(point,map.getZoom()); 
		
	});
	 
	 map.addOverlay(marker);  
	 
}

function jianku(id){
	$.ajax({
        type: "get",
        url: "wuye2Base.action",
        data: { "id": id },
        dataType: "jsonp",
        success: function (datas) {
            if(datas.success=='true'){
            	alert("建库成功.");
            }else if(datas.success=='already'){
            	alert("该物业已经被转成了建库项目,请选择另外一个.");
                return;
            }else if(datas.success=='sessionError'){
            	window.location = "index.html";
                return;
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert(errorThrown);
        }
    });
}

function loadDataperson_road() {
   
        var scrollPic_02 = new ScrollPic();
        scrollPic_02.scrollContId = "ISL_Cont_person_road"; //内容容器ID
        scrollPic_02.arrLeftId = "LeftArrperson_road"; //左箭头ID
        scrollPic_02.arrRightId = "RightArrperson_road"; //右箭头ID

        if (RegionUserInfoData.users.length < 4) {
            scrollPic_02.frameWidth = 80 * RegionUserInfoData.users.length; //显示框宽度
            scrollPic_02.pageWidth = 40 * RegionUserInfoData.users.length; //翻页宽度
        }
        else if (city_personData_road!=null&&city_personData_road!=0&&city_personData_road.split(',').length<4) {
            scrollPic_02.frameWidth = 80 * city_personData_road.split(',').length; //显示框宽度
            scrollPic_02.pageWidth = 40 * city_personData_road.split(',').length; //翻页宽度
        }
        else {
            scrollPic_02.frameWidth = 340; //显示框宽度
            scrollPic_02.pageWidth = 140; //翻页宽度
        }

        scrollPic_02.speed = 20; //移动速度(单位毫秒，越小越快)
        scrollPic_02.space = 2; //每次移动像素(单位px，越大越快)
        scrollPic_02.autoPlay = false; //自动播放
        scrollPic_02.autoPlayTime = 3; //自动播放间隔时间(秒)
        scrollPic_02.pageIndex = 0;
        //可以先判断长度，决定是否执行initialize方法
		if (RegionUserInfoData.users.length < 4||(city_personData_road!=null&&city_personData_road!=0&&city_personData_road.split(',').length<4)) {
            scrollPic_02.initializeLimit();  //初始化
        }
        else {
            scrollPic_02.initialize(); //初始化	
        }
        
        return;
   
}



    function loadDatacity_road() {
      
            var scrollPic_02 = new ScrollPic();
            scrollPic_02.scrollContId = "ISL_Cont_city_road"; //内容容器ID
            scrollPic_02.arrLeftId = "LeftArrcity_road"; //左箭头ID
            scrollPic_02.arrRightId = "RightArrcity_road"; //右箭头ID

            if (RegionUserInfoData.cities.length < 4) {
                scrollPic_02.frameWidth = 80 * RegionUserInfoData.cities.length; //显示框宽度
                scrollPic_02.pageWidth = 40 * RegionUserInfoData.cities.length; //翻页宽度
            }
            else {
                scrollPic_02.frameWidth = 340; //显示框宽度
                scrollPic_02.pageWidth = 140; //翻页宽度
            }

            scrollPic_02.speed = 20; //移动速度(单位毫秒，越小越快)
            scrollPic_02.space = 2; //每次移动像素(单位px，越大越快)
            scrollPic_02.autoPlay = false; //自动播放
            scrollPic_02.autoPlayTime = 3; //自动播放间隔时间(秒)
            scrollPic_02.pageIndex = 0;
            //可以先判断长度，决定是否执行initialize方法
			if (RegionUserInfoData.cities.length < 4) {
                scrollPic_02.initializeLimit();  //初始化
            }
            else {
                scrollPic_02.initialize();  //初始化	
            }
            
            return;
      
    }

    function loadDataroad() {
      
            var scrollPic_02 = new ScrollPic();
            scrollPic_02.scrollContId = "ISL_Cont_road"; //内容容器ID
            scrollPic_02.arrLeftId = "LeftArrroad"; //左箭头ID
            scrollPic_02.arrRightId = "RightArrroad"; //右箭头ID

           if (RegionUserInfoData.streets.length < 4) {
                scrollPic_02.frameWidth = 80 * RegionUserInfoData.streets.length; //显示框宽度
                scrollPic_02.pageWidth = 40 * RegionUserInfoData.streets.length; //翻页宽度
            }
            else if((person_roadData!=null&&person_roadData!=0&&person_roadData.split(',').length<4)){
                scrollPic_02.frameWidth = 80 * person_roadData.split(',').length; //显示框宽度
                scrollPic_02.pageWidth = 40 * person_roadData.split(',').length; //翻页宽度
            }
            else
            {
                scrollPic_02.frameWidth = 340; //显示框宽度
                scrollPic_02.pageWidth = 140; //翻页宽度
            }
            scrollPic_02.speed = 20; //移动速度(单位毫秒，越小越快)
            scrollPic_02.space = 5; //每次移动像素(单位px，越大越快)
            scrollPic_02.autoPlay = false; //自动播放
            scrollPic_02.autoPlayTime = 3; //自动播放间隔时间(秒)
            scrollPic_02.pageIndex = 0;
            //可以先判断长度，决定是否执行initialize方法

            if (RegionUserInfoData.streets.length < 4||(person_roadData!=null&&person_roadData!=0&&person_roadData.split(',').length<4)) {
                scrollPic_02.initializeLimit();  //初始化
            }
            else {
                scrollPic_02.initialize();  //初始化	
            }
            
            return;
      
    }

    function loadUserLocationInfo_road() {
		if(cityStr_road==-1||persionStr_road==-1||streetStr==-1)
		{
			clearMarker();
			$("#Shortlist_roadContent").html("");
			//alert("没有符合条件的数据！");
			return;
		}
		
		if(persionStr_road==0||persionStr_road=="0")
		{
         // persionStr_road = $("#person_roadList").find("span:first").attr("tag"); 
			var usersLenth = PersonData.length;
		 	for (var i = 0; i < usersLenth; i++) {	              
		                
				persionStr_road += PersonData[i].userId + ",";
			}
			if(persionStr_road.length > 1)
				persionStr_road = persionStr_road.substring(0, persionStr_road.length - 1);
		}
		
		if(streetStr==0||streetStr=="0")
		{
        	
			var roadLenth = StreetData.length;
			if(roadLenth > 0)
			{
               // streetStr = $("#roadList").find("span:first").attr("tag");
			 	for (var i = 0; i < roadLenth; i++) {	              
			                
					streetStr += StreetData[i].id + ",";
				}
				if(streetStr.length > 1)
					streetStr = streetStr.substring(0, streetStr.length - 1);
			}
			else			 
				streetStr=-1;			
			
		}
		
        $.ajax({
            type: "get",
            url: "fetchStreetPOIInfo.action",
            data: { "startdt": startdt_road, "enddt": enddt_road, "cityStr": cityStr_road, "persionStr": persionStr_road, "streetStr": streetStr, "page": page_road, "limit": limit },
            dataType: "jsonp",
            success: function (datas) {
            	if (datas.success == "sessionOut") {
	                window.location = "index.html";
	                return;
            	}
                clearMarker();
                showUserLocationInfo_road(datas);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
               // alert(errorThrown);
            }
        });
    }


    function showRegionUserInfo_road(data) {
        if (data.success == "true") {
       
            var cityLenth = data.cities.length;
            if (cityLenth > 0) {

                var inners = "";

                for (var i = 0; i < cityLenth; i++) {
					if(data.cities[i].name.length<7)
                    	inners += "<div class=box><P><span class='templink' tag='" + data.cities[i].id + "' onclick='city_roadClick(this)'>" + data.cities[i].name + "</span></P></div>";
                	else
                		inners += "<div class=boxl><P><span class='templink' tag='" + data.cities[i].id + "' onclick='city_roadClick(this)'>" + data.cities[i].name + "</span></P></div>";
                
                }
                $("#ISL_Cont_city_road").html("<div id='city_roadCon'></div>");
                $("#city_roadCon").html(inners);
                flagcity_road = true;
                loadDatacity_road();
            }
            var usersLenth = data.users.length;
            if (usersLenth > 0) {

                var inners = "";

                for (var i = 0; i < usersLenth; i++) {
					if(data.users[i].realname.length<7)
                    	inners += "<div class=box><P><span class='templink' tag='" + data.users[i].userId + "' onclick='person_roadClick(this)'>" + data.users[i].realname + "</span></P></div>";
					else
                		inners += "<div class=boxl><P><span class='templink' tag='" + data.users[i].userId + "' onclick='person_roadClick(this)'>" + data.users[i].realname + "</span></P></div>";
				}
                $("#ISL_Cont_person_road").html("<div id='person_roadCon'></div>");
                $("#person_roadCon").html(inners);
                flagperson_road = true;
                 loadDataperson_road();
            }

            var roadLenth = data.streets.length;
            if (roadLenth > 0) {

                var inners = "";

                for (var i = 0; i < roadLenth; i++) {
					if(data.streets[i].name.length<7)
                    	inners += "<div class=box><P><span class='templink' tag='" + data.streets[i].id + "' onclick='roadClick(this)'>" + data.streets[i].name + "</span></P></div>";
					else
                		inners += "<div class=boxl><P><span class='templink' tag='" + data.streets[i].id + "' onclick='roadClick(this)'>" + data.streets[i].name + "</span></P></div>";
				
                }

                $("#ISL_Cont_road").html("<div id='roadCon'></div>");
                $("#roadCon").html(inners);
                flagroad = true;
                loadDataroad();
            }
             $("#city_roadList").find("span:first").removeClass("templink").addClass("templinkactive");
             $("#person_roadList").find("span:first").removeClass("templink").addClass("templinkactive");
             $("#roadList").find("span:first").removeClass("templink").addClass("templinkactive");
        }
    }

 function city_roadClick(sender) {
        var alink04 = $("#city_roadList").find("span");
        cityStr_road = "";
        alink04.each(function () {
            $(this).removeClass("templinkactive").addClass("templink");
        });
        $(sender).removeClass("templink").addClass("templinkactive");
        alink04.each(function () {
            if ($(this).attr("class") == "templinkactive") {
                cityStr_road = $(this).attr("tag");
            }
        });
        if (cityStr_road == "") {
            cityStr_road = 0;
            $("#city_roadList").find("span:first").removeClass("templink").addClass("templinkactive");
        }
        personChange_road();
        page_road = 1;
        loadUserLocationInfo_road();
    }

    function person_roadClick(sender) {
        var alink05 = $("#person_roadList").find("span");
        persionStr_road = "";
        alink05.each(function () {
            $(this).removeClass("templinkactive").addClass("templink");
        });
        $(sender).removeClass("templink").addClass("templinkactive");
        alink05.each(function () {
            if ($(this).attr("class") == "templinkactive") {
                persionStr_road = $(this).attr("tag");
            }
        });
        if (persionStr_road == "") {
            persionStr_road = $("#person_roadList").find("span:first").attr("tag");
            $("#person_roadList").find("span:first").removeClass("templink").addClass("templinkactive");
        }
        roadChange();
        page_road = 1;
        loadUserLocationInfo_road();
    }
   

    function roadClick(sender) {
        var alink06 = $("#roadList").find("span");
        streetStr = "";
        alink06.each(function () {
            $(this).removeClass("templinkactive").addClass("templink");
        });
        $(sender).removeClass("templink").addClass("templinkactive");
        alink06.each(function () {
            if ($(this).attr("class") == "templinkactive") {
                streetStr = $(this).attr("tag");
            }
        });
        if (streetStr == "") {
            streetStr = $("#roadList").find("span:first").attr("tag");
            $("#roadList").find("span:first").removeClass("templink").addClass("templinkactive");
        }
         page_road = 1;
        loadUserLocationInfo_road();
    }

    function personChange_road() {
    	flagperson_road=false;
        var usersLenth = PersonData.length;
        var inners = "";
        if(cityStr_road!=0&&cityStr_road!="0")
        {
        	persionStr_road = 0;
	        for (var i = 0; i < usersLenth; i++) {
	            if (PersonData[i]!=undefined && PersonData[i].cityId == cityStr_road)
	            {
	            	if(PersonData[i].realname.length < 7)
	                	inners += "<div class=box><P><span class='templink' tag='" + PersonData[i].userId + "' onclick='person_roadClick(this)'>" + PersonData[i].realname + "</span></P></div>";
	         		else
	         			inners += "<div class=boxl><P><span class='templink' tag='" + PersonData[i].userId + "' onclick='person_roadClick(this)'>" + PersonData[i].realname + "</span></P></div>";
	         	
	         		persionStr_road += PersonData[i].userId + ",";
	         	}
	         }
	         if(persionStr_road != 0)    		
	         {
    		 	 persionStr_road = persionStr_road.substring(0, persionStr_road.length - 1);
		
	         	$("#person_roadList").find("span:first").attr("tag",persionStr_road); 
                city_personData_road =  persionStr_road;
	         } 
	         else
		      	persionStr_road = -1;   
         }
         else
         {
         	for (var i = 0; i < usersLenth; i++) {	   
	         	 if (PersonData[i]!=undefined) 
	         	 {     
	         	 	if(PersonData[i].realname.length < 7)
		            	inners += "<div class=box><P><span class='templink' tag='" + PersonData[i].userId + "' onclick='person_roadClick(this)'>" + PersonData[i].realname + "</span></P></div>";
		         	else
		         		inners += "<div class=boxl><P><span class='templink' tag='" + PersonData[i].userId + "' onclick='person_roadClick(this)'>" + PersonData[i].realname + "</span></P></div>";
		         
		         }
	         }
	         persionStr_road = 0;	  
	         $("#person_roadList").find("span:first").attr("tag","0") ;  
              city_personData_road =  persionStr_road;    
         }

        $("#ISL_Cont_person_road").html("<div id='person_roadCon'></div>");
            
        $("#person_roadCon").html(inners);
        
        $("#person_roadList").find("span:first").removeClass("templink").addClass("templinkactive");
		roadChange();
		flagperson_road = true;
        loadDataperson_road();
    }
    
      function roadChange() {
       flagroad = false;
        var streetsLenth = StreetData.length;
        var inners = "";
        streetStr = 0;
        if(persionStr_road == 0&&persionStr_road=="0")
        {
	        for (var i = 0; i < streetsLenth; i++) {
	            if (StreetData[i]!=undefined )
	            {
	            	if(StreetData[i].name.length < 7)
	                	inners += "<div class=box><P><span class='templink' tag='" + StreetData[i].id + "' onclick='roadClick(this)'>" + StreetData[i].name + "</span></P></div>";
	         		else
	         			inners += "<div class=boxl><P><span class='templink' tag='" + StreetData[i].id + "' onclick='roadClick(this)'>" + StreetData[i].name + "</span></P></div>";
	         	
	         		//streetStr += StreetData[i].id + ",";
	         	}
	         }
	         $("#roadList").find("span:first").attr("tag","0");
              person_roadData =  streetStr;
         }
         else
         {
             var persionStr_roads = persionStr_road.split(',');
             for (var n = 0; n < persionStr_roads.length; n++) {
				if (persionStr_roads[n]!=undefined)
		            for (var i = 0; i < streetsLenth; i++) {
		                if (StreetData[i]!=undefined && StreetData[i].userId == persionStr_roads[n])
		                {
		                	if(StreetData[i].name.length < 7)
		                    	inners += "<div class=box><P><span class='templink' tag='" + StreetData[i].id + "' onclick='roadClick(this)'>" + StreetData[i].name + "</span></P></div>";
							else
								inners += "<div class=boxl><P><span class='templink' tag='" + StreetData[i].id + "' onclick='roadClick(this)'>" + StreetData[i].name + "</span></P></div>";
							
							streetStr += StreetData[i].id + ",";
						}
		            }
		        }
		      if(streetStr != 0)    	
		      {	
    		  	streetStr = streetStr.substring(0, streetStr.length - 1);
		      	$("#roadList").find("span:first").attr("tag",streetStr);
                 person_roadData =  streetStr;
		      }
		      else
		      	streetStr = -1;
         }

        $("#ISL_Cont_road").html("<div id='roadCon'></div>");               
             
        $("#roadCon").html(inners);
      
        $("#roadList").find("span:first").removeClass("templink").addClass("templinkactive");
				
		if(inners!=""){
			    flagroad = true;
                loadDataroad();
            }
    }

    function showUserLocationInfo_road(data) {
        if (data.success == "true") {
        	roadResultData = data;
        	
        	if(data.totalSize>0)
	    	{
	    		page_road_totle = Math.ceil(data.totalSize/limit); 
	    		if (page_road == 1) {
		            $("#rdLeft").css("color","gray");	
	        	}else{
	        		$("#rdLeft").css("color","blue");	
	        	}   
	    		
	    		if(page_road_totle==1){
	    			$("#rdRight").css("color","gray");	
	    		}else{
	    			$("#rdRight").css("color","blue");	
	    		}			
	    		
	    		if(page_road == page_road_totle){
	    			$("#rdRight").css("color","gray");	
	    		}	
	   		}
            if (data.info != undefined && data.info.length!=0) {
                var infoLenth = data.info.length;

                if (infoLenth > 0) {
                    var inners = "";
                    for (var i = 0; i < infoLenth; i++) {

                        var contentS = data.info[i].content.split('||');
                        var name = "";
                        var type = "";
                        var addr = data.info[i].componentName;
                        if(addr==undefined || addr == 'undefined'){
					    	addr = "";	
					    }
                        for (var n = 0; n < contentS.length; n++) {
                            var cc = contentS[n].split('|');
                            switch (cc[0]) {
                                case "222":
                                    type = cc[1];
                                    break;
                                case "229":
                                    name = cc[1];
                                    break;
                                case "230":
                                   // addr = cc[1];
                                    break;
                                case "231":
                                    addr += cc[1];
                                    if(cc[1]!=""&&cc[1].indexOf("号")==-1)
                                        addr += "号";
                                    break;
                            }
                        }
                        var latlon = data.info[i].location.split(',');
                        var lat = latlon[0];
                        var lon = latlon[1];
                        
                        inners += " <div id='listarea'>";
                        inners += "<div id='listareaLeft'><img src='images/build_temp_pic.gif' width='40' height='40' /></div>";
                        inners += "<div id='listareaRight'>";
                        inners += "<div id='topcontent'>";
                        inners += "<div id='name3'><a href='javascript:detailInfo_road("+data.info[i].id+","+lat+","+lon+")'>" + name + "</a></div>";
                        inners += " <div id='type3'>类型：" + type + "</div>";
                        inners += "<div id='time3'><img src='images/time_ico.gif' width='18' height='18' class='ico' />" + data.info[i].formatDate + "</div>";
                        inners += " </div>  ";
                        inners += "<div id='bottomcontent'>";
                        inners += "<div id='address'>" + addr + "</div>";
                      
                        inners += "<div id='status'><a href='javascript:detailInfo_road("+data.info[i].id+","+lat+","+lon+")'>地图显示</a></div>";
                        inners += " </div>  ";
                        inners += " </div>  ";
                        inners += " </div>  ";

                       
                        if (lat != null && lon != null && positionInChina(lat, lon)) {
                         
                            var point = new BMap.Point(lon, lat);    // 创建点坐标
                            if (i == 0) {
                                map.centerAndZoom(point, 13);                     // 初始化地图,设置中心点坐标和地图级别。
                            }
                            pintterArr.push(point);
                            addMarker_road(point, i, data.info[i].posType, data.info[i]);
                        }
                    }
                    if (pintterArr != null && pintterArr.length > 0)
                        map.setViewport(pintterArr);

                    $("#Shortlist_roadContent").html(inners);
                }
            }
            else {
            	$("#Shortlist_roadContent").html("");
//                if ($("#menulist_road").css("visibility") == "visible")
                    //alert("没有符合条件的数据！");
            }
        }
    }
	
	function detailInfo_road(rid,lat,lon){	 
       if (lat != null && lon != null && positionInChina(lat, lon)) { 
                            
           var point = new BMap.Point(lon, lat);  
           var infoLenth = roadResultData.info.length;
	       if (infoLenth > 0) {   
	       for (var i = 0; i < infoLenth; i++) {  
				if(roadResultData.info[i].id==rid)
				{ 
					var obj=roadResultData.info[i];
					var contentS = obj.content.split('||');
				    var name = "";
				    var type = "";
				    var addr = obj.componentName;
				    if(addr==undefined || addr == 'undefined'){
				    	addr = "";	
				    }
				    var menpai="";
				    var other="";
				    for (var n = 0; n < contentS.length; n++) {
				    var cc = contentS[n].split('|');
				    switch (cc[0]) {
				        case "222":
				             type = cc[1];
				             break;
				         case "229":
				             name = cc[1];
				             break;
				         case "230":
				             //addr = cc[1];
				             break;
				         case "231":
				             menpai = cc[1];
                             addr += menpai;
                             if(menpai!=""&&menpai.indexOf("号")==-1)
                                addr += "号";
				             break;
				         case "232":
				             other = cc[1];
				             break;
				        }
				    }
				    
				   var htmlText = '<div id="popup_bg2">';
					htmlText+=     ' <div id="closebtn"><font style="cursor:pointer;" onclick="jianku('+obj.id+')"><img src="images/jianku.gif" style="vertical-align:middle;" width="48" height="24" /></font></div>';
					htmlText+=     '      <div id="textarea">';
					htmlText+=     '           <ul>';
					htmlText+=     '               <li><strong>名称</strong>：'+name+'</li>';
					htmlText+=     '               <li><strong>时间</strong>：'+obj.formatDate+'</li>';
					htmlText+=     '               <li><strong>类型</strong>：'+type+'</li>';
					htmlText+=     '               <li><strong>地址</strong>：'+addr+'</li>';
			//		htmlText+=     '               <li><strong>门牌号</strong>：'+menpai+'</li>';
			        htmlText+=     '               <li><strong>描述</strong>：'+other+'</li>';
			        //htmlText+=     '               <li><font style="cursor:pointer;" onclick="jianku('+obj.id+')"><img src="images/btn_jk_d.png" width="110" height="40" /></font></li>';
					htmlText+=     '           </ul>';
					htmlText+=     '      </div>';
					htmlText+=     '<div id="picBG">';
					if(obj.imageUrl!=null){
						htmlText+=     '<a href ="'+obj.imageUrl+'" target=_blank><img src="'+obj.imageUrl+'" width="345" height="124" /></a>';
					}else{
						htmlText+=     '           <div id="leftbtn"><a href="#"><img src="images/left_btn.png" width="22" height="47" /></a></div>';
						htmlText+=     '           <div id="rightbtn"><a href="#"><img src="images/right_btn.png" width="22" height="47" /></a></div>';
					}
					htmlText+=     '      </div>';
					htmlText+=     ' </div>';
					htmlText+=     '</div>';
			
					var opts = {  
					 width : 345,     // 信息窗口宽度  
					 height: 290,     // 信息窗口高度  
					 //title : "<b>"+name+"</b>"  // 信息窗口标题  
					}
					  
					var infoWindow = new BMap.InfoWindow(htmlText, opts);  // 创建信息窗口对象  
					map.openInfoWindow(infoWindow, point);      // 打开信息窗口       
                }
             }
           }
           map.centerAndZoom(point, 17);                   
       }      
	}

    function dateChange_road() {

        if ( $("#dateTimeroad1").val() != "" && $("#dateTimeroad2").val() != "") {
            startdt_road = $("#dateTimeroad1").val();
            enddt_road = $("#dateTimeroad2").val();
             page_road = 1;
            loadUserLocationInfo_road();
        }
        else  {
            startdt_road = $("#dateTimeroad1").val();
            enddt_road = $("#dateTimeroad2").val();
        }
    }

    function previousPage_road() {
        if (page_road == 1) {
          	//alert("已是第一页！");
            return false;
        }
        map.clearOverlays();
        pintterArr = new Array();
        page_road = page_road - 1;
        if(page_road==1){
        	$("#rdLeft").css("color","gray");	
        }
    	$("#rdRight").css("color","blue");	
        
        loadUserLocationInfo_road();
    }

    function nextPage_road() {
    	if(page_road == page_road_totle){
    	  	//alert("已是最后页！");
			return false;
		}
        map.clearOverlays();
        pintterArr = new Array();
        page_road = page_road + 1;
        if(page_road == page_road_totle){
        	$("#rdRight").css("color","gray");	
        }
    	$("#rdLeft").css("color","blue");	
        
        loadUserLocationInfo_road();
    }
    
    function roadManager2Excel() {
    if (persionStr == -1) {
        return;
    }
     $("#export2img").css("visibility", "visible");
    $.ajax({
        type: "get",
        url: "exportStreetInfo2Excel.action",
        data: { "startdt": startdt_road, "enddt": enddt_road, "cityStr": cityStr_road, "persionStr": persionStr_road, "streetStr": streetStr, "page": 1, "limit": limit },
        dataType: "jsonp",
        success: function (datas) {
            openwin2(datas.fileURL)
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
           // alert(errorThrown);
        }
    });
}

function openwin2(url) {
    $("#export2").attr("href", url);
    $("#export2img").attr("src", "images/upload.png");
}

function roadManagerExport() {
    $("#export2img").css("visibility", "hidden");
    $("#export2img").attr("src", "images/load.gif");

}